$(function() {
	$('#vue_vm_list div').hide();
});

var volunteerOrder = {
	volunteerOrderId: '',
	volunteerName: '',
	contactName: '',
	contactPhoneNumber: '',
	subjectRoomId: getLoginedUser().subjectRoomId,
	subjectRoomName: getLoginedUser().subjectRoomName,
	startTime: '',
	endTime: '',
	activityContent: '',
	doStatus: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
};

var view = {
	data: volunteerOrder
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view
});

function save() {
	view.data.startTime = $('#startYear').val() + '-' + $('#startMonth').val() + '-' + $('#startDay').val();
	view.data.endTime = $('#endYear').val() + '-' + $('#endMonth').val() + '-' + $('#endDay').val();
	//view.data.doStatus = (view.data.doStatus==''? 0: parseInt(view.data.doStatus));
	view.data.doStatus = 1;

	save_basic(path+'/volunteerOrder/save', {volunteerOrder:view.data}, function() {
		alert('预约成功');
	});
}

function findAll() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();

	findAll_basic(path+'/volunteerOrder/findAll', function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/volunteerOrder/deleteBatch');
}
